package com.wayhome.springframework.beans.factory;

import java.util.ArrayList;
import java.util.List;

public class PropertyValues {


    private List<PropertyValue> propertyValueList = new ArrayList<PropertyValue>();

    public void addPropertyValue(PropertyValue propertyValue){
        this.propertyValueList.add(propertyValue);
    }

    public PropertyValue[] getPropertyValues(){
        return this.propertyValueList.toArray(new PropertyValue[0]);
    }

    public PropertyValue getPropertyValue(String name){
        for (PropertyValue propertyValue : propertyValueList){
            if (name.equals(propertyValue.getName())){
                return propertyValue;
            }
        }
        return null;
    }

}
